<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserAddEdit.ascx.cs" Inherits="IGlobalist.Cms.Admin.Control.UserAddEdit" %>
<%@ Register Src="CmsExtPropertiesForm.ascx" TagName="CmsExtPropertiesForm" TagPrefix="uc1" %>
  
   <table>
   <tr>
        <th colspan="2" align="center">
            <asp:Label runat="server" ID="lblStatus" ForeColor="#1A5688" Font-Bold="True" Font-Size="Medium"/>
        </th>        
   </tr>
   <tr>
    <td align="left">
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True" />
        <asp:Label id="lblErrorRole" ForeColor="red" runat="server" Text=""></asp:Label>    
        
    </td>
   </tr>
    <tr>
        <td valign="top">
        <fieldset id="fsMain" runat="server">
            <legend><asp:Label ID="lblMain"  runat="server"  Text="Main Properties"></asp:Label> </legend>
                <table cellpadding="2" cellspacing="2">                    
                    <tr>
                        <td><br />
                        </td>
                    </tr>
                    <tr>
                        <td>
                        User Class    
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlClassPage" runat="server" AutoPostBack="True" Enabled="False" OnSelectedIndexChanged="ddlClassPage_SelectedIndexChanged" DataSourceID="ODSClassPage" DataTextField="Name" DataValueField="ID" >
            </asp:DropDownList>
            <asp:ObjectDataSource ID="ODSClassPage" runat="server" SelectMethod="GetClassListByClassTypeID"  TypeName="IGlobalist.Cms.Bll.ClassController">
                <SelectParameters>
                        <asp:Parameter DefaultValue="2" Name="classTypeID" Type="Int16" />
                </SelectParameters>
            </asp:ObjectDataSource>
                        </td>
                    </tr>
                    <tr align="left">
                        <td><asp:Label ID="lblName" runat="server" Text="User Name"></asp:Label></td>
                        <td><asp:TextBox ID="tbName" runat="server"></asp:TextBox>
                             <asp:RequiredFieldValidator ID="rfvddlPage" runat="server" ControlToValidate="tbName"
                ErrorMessage="Require UserName" >*</asp:RequiredFieldValidator>
                            <asp:Label ID="lblError" runat="server" Text="" ForeColor="red"></asp:Label> 
                        </td>
                    </tr>
                   
                    <tr>
                        <td><asp:Label ID="Label4" runat="server" Text="First Name"></asp:Label></td>
                        <td align="left"><asp:TextBox ID="tbFirstName" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                     <tr>
                        <td><asp:Label ID="Label7" runat="server" Text="Last Name"></asp:Label></td>
                        <td align="left"><asp:TextBox ID="tbLastName" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                     <tr>
                        <td><asp:Label ID="Label9" runat="server" Text="Middle Name"></asp:Label></td>
                        <td align="left"><asp:TextBox ID="tbMiddle" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="Label3" runat="server" Text="Email"></asp:Label></td>
                        <td align="left"><asp:TextBox ID="tbEmail" runat="server"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="tbEmail"
                                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ErrorMessage="Email Invalid!">*</asp:RegularExpressionValidator></td>
                    </tr>
                    
                     <tr>
                        <td><asp:Label ID="Label5" runat="server" Text="Password"></asp:Label></td>
                        <td align="left"><asp:TextBox ID="tbPassword" runat="server" TextMode="SingleLine"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbPassword"
                ErrorMessage="Require Password" >*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    
                     <tr>
                        <td valign="top">
                            <asp:Label ID="Label2" runat="server" Text="Description"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="tbDescription" runat="server" Rows="4" Height="100px" TextMode="MultiLine"></asp:TextBox>
                        </td>
                    </tr>  
                       
                    <tr>
                        <td><asp:Label ID="Label1" runat="server" Text="Roles"></asp:Label></td> 
                        <td align="left">
                        
                          <asp:DataList ID="dlRoles" runat="server"  OnItemDataBound="dlRoles_ItemDataBound" >
                             <ItemTemplate>
                            <asp:HiddenField ID="hdnClassID" runat="server" Value='<%# DataBinder.Eval(Container, "DataItem.ID") %>' />
                                <asp:Label ID="lblName" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Name") %>' Font-Bold="true"></asp:Label><br />
                                <asp:Repeater ID="rptRole" runat="server">
                                <ItemTemplate>
                                    <asp:HiddenField ID="hdnRoleID" runat="server" Value='<%# DataBinder.Eval(Container, "DataItem.ID") %>' />
                                    &nbsp; <asp:Label runat="server" ID="lblName" Text='<%# DataBinder.Eval(Container, "DataItem.Name") %>'></asp:Label><asp:CheckBox ID="cbRole"  runat="server" Checked='<%# IsRole((long) DataBinder.Eval(Container.DataItem,"ID")) %>'  />
                                       
                                 </ItemTemplate>   
                                </asp:Repeater>
                          
                         </ItemTemplate>
                        </asp:DataList>                           
                       
                        </td>     
                    </tr>           
               </table>   
        </fieldset> 
        </td>
    </tr>
    
 
    <tr>
        <td>
            <fieldset id="fsExt" runat="server" visible="false">
                <legend><asp:Label ID="lblExt"  runat="server"  Text="Ext Properties"></asp:Label> </legend>               
                <uc1:CmsExtPropertiesForm ID="ucCmsExtPropertiesForm" runat="server" />
                
            </fieldset> 
        </td>
    </tr>
 
    </table> 
 


